<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>第十七章 动画与canvas | 伊水河的博客</title>
    <meta name="generator" content="VuePress 1.7.1">
    <link rel="icon" href="/logo.png">
    <meta name="description" content="SO FAR SO GOOD">
    <meta name="twitter:title" content="第十七章 动画与canvas">
    <meta name="twitter:description" content="">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:url" content="https://yihe.cool/note/professionalJavascript4/18.html">
    <meta property="og:type" content="article">
    <meta property="og:title" content="第十七章 动画与canvas">
    <meta property="og:description" content="">
    <meta property="og:url" content="https://yihe.cool/note/professionalJavascript4/18.html">
    <meta property="article:author" content="伊水河">
    <meta property="article:published_time" content="2021-02-24T10:50:00.000Z">
    <meta property="article:tag" content="javascript高级程序设计">
    <meta itemprop="name" content="第十七章 动画与canvas">
    <meta itemprop="description" content="">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="/assets/css/0.styles.152c4062.css" as="style"><link rel="preload" href="/assets/js/app.2d22f3f9.js" as="script"><link rel="preload" href="/assets/js/3.6721f6a0.js" as="script"><link rel="preload" href="/assets/js/1.546ea5a7.js" as="script"><link rel="preload" href="/assets/js/50.0ad5db28.js" as="script"><link rel="prefetch" href="/assets/js/10.b827ae65.js"><link rel="prefetch" href="/assets/js/11.5e38b612.js"><link rel="prefetch" href="/assets/js/12.3f3699b0.js"><link rel="prefetch" href="/assets/js/13.7d83bc51.js"><link rel="prefetch" href="/assets/js/14.2ea90c77.js"><link rel="prefetch" href="/assets/js/15.7df6d74c.js"><link rel="prefetch" href="/assets/js/16.33c1bac8.js"><link rel="prefetch" href="/assets/js/17.1aef86d1.js"><link rel="prefetch" href="/assets/js/18.b74cd2bd.js"><link rel="prefetch" href="/assets/js/19.73f82cea.js"><link rel="prefetch" href="/assets/js/20.6354096e.js"><link rel="prefetch" href="/assets/js/21.fd87273b.js"><link rel="prefetch" href="/assets/js/22.f90ee83e.js"><link rel="prefetch" href="/assets/js/23.e5f4f0a1.js"><link rel="prefetch" href="/assets/js/24.239130eb.js"><link rel="prefetch" href="/assets/js/25.db493ad9.js"><link rel="prefetch" href="/assets/js/26.26f3df98.js"><link rel="prefetch" href="/assets/js/27.d55bc04b.js"><link rel="prefetch" href="/assets/js/28.ac3a437a.js"><link rel="prefetch" href="/assets/js/29.9abce28f.js"><link rel="prefetch" href="/assets/js/30.ea843119.js"><link rel="prefetch" href="/assets/js/31.30a083bf.js"><link rel="prefetch" href="/assets/js/32.5f0b6b12.js"><link rel="prefetch" href="/assets/js/33.11456c83.js"><link rel="prefetch" href="/assets/js/34.e9ede601.js"><link rel="prefetch" href="/assets/js/35.17e5bb78.js"><link rel="prefetch" href="/assets/js/36.2f441457.js"><link rel="prefetch" href="/assets/js/37.e9fa7538.js"><link rel="prefetch" href="/assets/js/38.6bd1c237.js"><link rel="prefetch" href="/assets/js/39.8b0b956e.js"><link rel="prefetch" href="/assets/js/4.3ad057db.js"><link rel="prefetch" href="/assets/js/40.89ef1936.js"><link rel="prefetch" href="/assets/js/41.48d0560d.js"><link rel="prefetch" href="/assets/js/42.f804c44f.js"><link rel="prefetch" href="/assets/js/43.9dc6d003.js"><link rel="prefetch" href="/assets/js/44.3033d12c.js"><link rel="prefetch" href="/assets/js/45.60834ce1.js"><link rel="prefetch" href="/assets/js/46.c7eaf70d.js"><link rel="prefetch" href="/assets/js/47.a618490c.js"><link rel="prefetch" href="/assets/js/48.39a68335.js"><link rel="prefetch" href="/assets/js/49.1fa3bd55.js"><link rel="prefetch" href="/assets/js/5.4b2144a0.js"><link rel="prefetch" href="/assets/js/51.843c519b.js"><link rel="prefetch" href="/assets/js/52.47d63846.js"><link rel="prefetch" href="/assets/js/53.5284b79d.js"><link rel="prefetch" href="/assets/js/54.b10b8ac1.js"><link rel="prefetch" href="/assets/js/55.3780915d.js"><link rel="prefetch" href="/assets/js/56.4a811b5c.js"><link rel="prefetch" href="/assets/js/57.228652ee.js"><link rel="prefetch" href="/assets/js/58.ef55d2ec.js"><link rel="prefetch" href="/assets/js/59.cbb81185.js"><link rel="prefetch" href="/assets/js/6.3dafc094.js"><link rel="prefetch" href="/assets/js/60.5257b363.js"><link rel="prefetch" href="/assets/js/61.03db625c.js"><link rel="prefetch" href="/assets/js/62.5982e690.js"><link rel="prefetch" href="/assets/js/63.0eccb44b.js"><link rel="prefetch" href="/assets/js/64.d92985de.js"><link rel="prefetch" href="/assets/js/65.4fd6aed1.js"><link rel="prefetch" href="/assets/js/66.acaf73d6.js"><link rel="prefetch" href="/assets/js/67.6db75c01.js"><link rel="prefetch" href="/assets/js/68.1dce863f.js"><link rel="prefetch" href="/assets/js/69.4222a30b.js"><link rel="prefetch" href="/assets/js/7.be8adaa3.js"><link rel="prefetch" href="/assets/js/8.3121f1c6.js"><link rel="prefetch" href="/assets/js/9.03dc3458.js">
    <link rel="stylesheet" href="/assets/css/0.styles.152c4062.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container" data-v-2d5f533b><div data-v-2d5f533b><div id="loader-wrapper" class="loading-wrapper" data-v-d48f4d20 data-v-2d5f533b data-v-2d5f533b><div class="loader-main" data-v-d48f4d20><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-64685f0e data-v-2d5f533b data-v-2d5f533b><h3 class="title" style="display:none;" data-v-64685f0e data-v-64685f0e>伊水河的博客</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-64685f0e data-v-64685f0e><input type="password" value="" data-v-64685f0e> <span data-v-64685f0e>Konck! Knock!</span> <button data-v-64685f0e>OK</button></label> <div class="footer" style="display:none;" data-v-64685f0e data-v-64685f0e><span data-v-64685f0e><i class="iconfont reco-theme" data-v-64685f0e></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-64685f0e>vuePress-theme-reco</a></span> <span data-v-64685f0e><i class="iconfont reco-copyright" data-v-64685f0e></i> <a data-v-64685f0e><span data-v-64685f0e>伊水河</span>
            
          <span data-v-64685f0e>2020 - </span>
          2021
        </a></span></div></div> <div class="hide" data-v-2d5f533b><header class="navbar" data-v-2d5f533b><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">伊水河的博客</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/categories/前端/" class="nav-link"><i class="iconfont reco-blog"></i>
  前端
</a></div><div class="nav-item"><a href="/categories/leetcode/" class="nav-link"><i class="iconfont reco-coding"></i>
  力扣
</a></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/note/" class="nav-link router-link-active"><i class="iconfont reco-suggestion"></i>
  笔记
</a></div><div class="nav-item"><a href="/todo/" class="nav-link"><i class="iconfont reco-document"></i>
  TODO
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-account"></i>
      关于
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://juejin.cn/user/571401777456621" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-juejin"></i>
  掘金
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://yishuihe.gitee.io" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-mayun"></i>
  码云
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://github.com/lixiang89" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  github
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://node.kg.qq.com/personal?uid=659d9d802d253e8231" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont "></i>
  全民K歌
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-2d5f533b></div> <aside class="sidebar" data-v-2d5f533b><div class="personal-info-wrapper" data-v-ca798c94 data-v-2d5f533b><img src="/b.jpg" alt="author-avatar" class="personal-img" data-v-ca798c94> <h3 class="name" data-v-ca798c94>
    伊水河
  </h3> <div class="num" data-v-ca798c94><div data-v-ca798c94><h3 data-v-ca798c94>51</h3> <h6 data-v-ca798c94>文章</h6></div> <div data-v-ca798c94><h3 data-v-ca798c94>13</h3> <h6 data-v-ca798c94>标签</h6></div></div> <hr data-v-ca798c94></div> <nav class="nav-links"><div class="nav-item"><a href="/categories/前端/" class="nav-link"><i class="iconfont reco-blog"></i>
  前端
</a></div><div class="nav-item"><a href="/categories/leetcode/" class="nav-link"><i class="iconfont reco-coding"></i>
  力扣
</a></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/note/" class="nav-link router-link-active"><i class="iconfont reco-suggestion"></i>
  笔记
</a></div><div class="nav-item"><a href="/todo/" class="nav-link"><i class="iconfont reco-document"></i>
  TODO
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-account"></i>
      关于
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://juejin.cn/user/571401777456621" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-juejin"></i>
  掘金
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://yishuihe.gitee.io" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-mayun"></i>
  码云
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://github.com/lixiang89" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  github
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://node.kg.qq.com/personal?uid=659d9d802d253e8231" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont "></i>
  全民K歌
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><a href="/note/professionalJavascript4/" aria-current="page" class="sidebar-link">前言</a></li><li><a href="/note/professionalJavascript4/2.html" class="sidebar-link">第二章 HTML中的javascript</a></li><li><a href="/note/professionalJavascript4/3.html" class="sidebar-link">第三章 语言基础</a></li><li><a href="/note/professionalJavascript4/4.html" class="sidebar-link">第四章 变量、作用域、内存</a></li><li><a href="/note/professionalJavascript4/5.html" class="sidebar-link">第五章 基本引用类型</a></li><li><a href="/note/professionalJavascript4/6.html" class="sidebar-link">第六章 集合引用类型</a></li><li><a href="/note/professionalJavascript4/7.html" class="sidebar-link">第七章 迭代器和生成器</a></li><li><a href="/note/professionalJavascript4/8.html" class="sidebar-link">第八章 对象、类与面向对象编程</a></li><li><a href="/note/professionalJavascript4/9.html" class="sidebar-link">第九章 代理与反射</a></li><li><a href="/note/professionalJavascript4/10.html" class="sidebar-link">第十章 函数</a></li><li><a href="/note/professionalJavascript4/11.html" class="sidebar-link">第十一章 期约（Promise）与异步（async）函数</a></li><li><a href="/note/professionalJavascript4/12.html" class="sidebar-link">第十二章 BOM</a></li><li><a href="/note/professionalJavascript4/13.html" class="sidebar-link">第十三章 客户端检测</a></li><li><a href="/note/professionalJavascript4/14.html" class="sidebar-link">第十四/十五/十六章 DOM</a></li><li><a href="/note/professionalJavascript4/17.html" class="sidebar-link">第十七章 事件</a></li><li><a href="/note/professionalJavascript4/18.html" aria-current="page" class="active sidebar-link">第十七章 动画与canvas</a></li><li><a href="/note/professionalJavascript4/19.html" class="sidebar-link">第十九章 表单脚本</a></li><li><a href="/note/professionalJavascript4/24.html" class="sidebar-link">第二十四章 网络请求与远程资源</a></li><li><a href="/note/professionalJavascript4/25.html" class="sidebar-link">第二十五章 客户端存储</a></li><li><a href="/note/professionalJavascript4/26.html" class="sidebar-link">第二十六章 模块</a></li><li><a href="/note/professionalJavascript4/27.html" class="sidebar-link">第二十七章 工作者线程（worker）</a></li></ul> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-64685f0e data-v-2d5f533b><h3 class="title" style="display:none;" data-v-64685f0e data-v-64685f0e>第十七章 动画与canvas</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-64685f0e data-v-64685f0e><input type="password" value="" data-v-64685f0e> <span data-v-64685f0e>Konck! Knock!</span> <button data-v-64685f0e>OK</button></label> <div class="footer" style="display:none;" data-v-64685f0e data-v-64685f0e><span data-v-64685f0e><i class="iconfont reco-theme" data-v-64685f0e></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-64685f0e>vuePress-theme-reco</a></span> <span data-v-64685f0e><i class="iconfont reco-copyright" data-v-64685f0e></i> <a data-v-64685f0e><span data-v-64685f0e>伊水河</span>
            
          <span data-v-64685f0e>2020 - </span>
          2021
        </a></span></div></div> <div data-v-2d5f533b><main class="page"><div class="page-title" style="display:none;"><h1 class="title">第十七章 动画与canvas</h1> <div data-v-3b7f5bdf><i class="iconfont reco-account" data-v-3b7f5bdf><span data-v-3b7f5bdf>伊水河</span></i> <i class="iconfont reco-date" data-v-3b7f5bdf><span data-v-3b7f5bdf>2021-02-24 10:50:00</span></i> <i class="iconfont reco-eye" data-v-3b7f5bdf><span id="/note/professionalJavascript4/18.html" data-flag-title="Your Article Title" class="leancloud-visitors" data-v-3b7f5bdf><a class="leancloud-visitors-count" style="font-size:.9rem;font-weight:normal;color:#999;"></a></span></i> <i class="iconfont reco-tag tags" data-v-3b7f5bdf><span class="tag-item" data-v-3b7f5bdf>javascript高级程序设计</span></i></div></div> <div class="theme-reco-content content__default" style="display:none;"><h2 id="requestanimationframe"><a href="#requestanimationframe" class="header-anchor">#</a> requestAnimationFrame</h2> <p>requestAnimationFrame(callback) 函数告诉浏览器，你希望执行一个动画，并且要求浏览器在下次重绘前调用指定的回调函数。callback会在浏览器下次重绘之前执行。（mdn描述）返回一个id，可用于取消该任务。</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// &lt;div id=&quot;status&quot; style=&quot;width:10px&quot;&gt;666&lt;/div&gt;</span>

<span class="token keyword">function</span> <span class="token function">updateProgress</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">var</span> div<span class="token operator">=</span>document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;status&quot;</span><span class="token punctuation">)</span>
    div<span class="token punctuation">.</span>style<span class="token punctuation">.</span>width<span class="token operator">=</span><span class="token punctuation">(</span><span class="token function">parseInt</span><span class="token punctuation">(</span>div<span class="token punctuation">.</span>style<span class="token punctuation">.</span>width<span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token string">&quot;%&quot;</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span>div<span class="token punctuation">.</span>style<span class="token punctuation">.</span>width<span class="token operator">!=</span><span class="token string">&quot;100%&quot;</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        <span class="token function">requestAnimationFrame</span><span class="token punctuation">(</span>updateProgress<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token function">requestAnimationFrame</span><span class="token punctuation">(</span>updateProgress<span class="token punctuation">)</span>
</code></pre></div><p>因为requestAnimationFrame只会调用一次传入的函数，所以每次更新界面时都需要调用一次。</p> <ul><li>callback执行次数通常是每秒60次</li></ul> <h3 id="取消"><a href="#取消" class="header-anchor">#</a> 取消</h3> <p>cancelAnimationFrame(id) 取消requestAnimationFrame。</p> <h3 id="实现节流"><a href="#实现节流" class="header-anchor">#</a> 实现节流</h3> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> enabled <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
<span class="token keyword">function</span> <span class="token function">expensiveOperation</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'Invoked at'</span><span class="token punctuation">,</span> Date<span class="token punctuation">.</span><span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
window<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'scroll'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>enabled<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        enabled <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
        window<span class="token punctuation">.</span><span class="token function">requestAnimationFrame</span><span class="token punctuation">(</span>expensiveOperation<span class="token punctuation">)</span><span class="token punctuation">;</span>
        window<span class="token punctuation">.</span><span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> enabled <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h2 id="canvas"><a href="#canvas" class="header-anchor">#</a> canvas</h2> <p>创建canvas元素时至少要设定其width和height属性。在标签中的内容会在浏览器不支持canvas时显示。</p> <div class="language-html extra-class"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>canvas</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>drawing<span class="token punctuation">&quot;</span></span> <span class="token attr-name">width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span> <span class="token attr-name">height</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>drawing sth.<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>canvas</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> drawing<span class="token operator">=</span>documnet<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;drawing&quot;</span><span class="token punctuation">)</span>
<span class="token comment">// 判断是否支持canvas</span>
<span class="token keyword">if</span><span class="token punctuation">(</span>drawing<span class="token punctuation">.</span>getContext<span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">let</span> context <span class="token operator">=</span> drawing<span class="token punctuation">.</span><span class="token function">getContext</span><span class="token punctuation">(</span><span class="token string">&quot;2d&quot;</span><span class="token punctuation">)</span>
    <span class="token comment">// 取得图像的数据URI</span>
    <span class="token keyword">let</span> imgURI<span class="token operator">=</span>drawing<span class="token punctuation">.</span><span class="token function">toDataURL</span><span class="token punctuation">(</span><span class="token string">&quot;image/png&quot;</span><span class="token punctuation">)</span>

    <span class="token keyword">let</span> image<span class="token operator">=</span>document<span class="token punctuation">.</span><span class="token function">createElement</span><span class="token punctuation">(</span><span class="token string">&quot;img&quot;</span><span class="token punctuation">)</span>
    image<span class="token punctuation">.</span>src<span class="token operator">=</span>imgURI
    document<span class="token punctuation">.</span>body<span class="token punctuation">.</span><span class="token function">appentChild</span><span class="token punctuation">(</span>image<span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="矩形"><a href="#矩形" class="header-anchor">#</a> 矩形</h3> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// 填充（实心）</span>
context<span class="token punctuation">.</span>fillStyle <span class="token operator">=</span> <span class="token string">&quot;#ff0000&quot;</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">fillRect</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//空心（stroke设置画笔颜色）</span>
context<span class="token punctuation">.</span>strokeStyle <span class="token operator">=</span> <span class="token string">&quot;#ff0000&quot;</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">stokeRect</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 擦除一个矩形</span>
context<span class="token punctuation">.</span><span class="token function">clearRect</span><span class="token punctuation">(</span><span class="token number">40</span><span class="token punctuation">,</span><span class="token number">40</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">)</span>
</code></pre></div><p>以上三个方法的参数依次是：x坐标；y坐标；宽；高。</p> <h3 id="路径"><a href="#路径" class="header-anchor">#</a> 路径</h3> <p>通过路径可以创建复杂的形状和线条。要绘制路径，必须首先调用 beginPath()方法以表示要开始绘制新路径。然后，再调用下列方法来绘制路径。</p> <ul><li>arc(x, y, radius, startAngle, endAngle, counterclockwise)：以坐标(x, y)为圆心，以 radius 为半径绘制一条弧线，起始角度为 startAngle，结束角度为 endAngle（都是弧度）。最后一个参数 counterclockwise 表示是否逆时针计算起始角度和结束角度（默认为顺时针）。</li> <li>arcTo(x1, y1, x2, y2, radius)：以给定半径 radius，经由(x1, y1)绘制一条从上一点到(x2, y2)的弧线。</li> <li>bezierCurveTo(c1x, c1y, c2x, c2y, x, y)：以(c1x, c1y)和(c2x, c2y)为控制点，绘制一条从上一点到(x, y)的弧线（三次贝塞尔曲线）。</li> <li>lineTo(x, y)：绘制一条从上一点到(x, y)的直线。</li> <li>moveTo(x, y)：不绘制线条，只把绘制光标移动到(x, y)。</li> <li>quadraticCurveTo(cx, cy, x, y)：以(cx, cy)为控制点，绘制一条从上一点到(x, y)的弧线（二次贝塞尔曲线）。</li> <li>rect(x, y, width, height)：以给定宽度和高度在坐标点(x, y)绘制一个矩形。这个方法与 strokeRect()和 fillRect()的区别在于，它创建的是一条路径，而不是独立的图形。</li></ul> <p>创建路径之后，可以使用 closePath()方法绘制一条回起点的线。如果路径已经完成，则既可以指定 fillStyle 属性并调用 fill()方法来填充路径，也可以指定 strokeStyle 属性并调用stroke()方法来描画路径，还可以调用 clip()方法基于已有路径创建一个新剪切区域。</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> context <span class="token operator">=</span> drawing<span class="token punctuation">.</span><span class="token function">getContext</span><span class="token punctuation">(</span><span class="token string">&quot;2d&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 创建路径</span>
context<span class="token punctuation">.</span><span class="token function">beginPath</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 绘制外圆</span>
context<span class="token punctuation">.</span><span class="token function">arc</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">99</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">2</span> <span class="token operator">*</span> Math<span class="token punctuation">.</span><span class="token constant">PI</span><span class="token punctuation">,</span> <span class="token boolean">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 绘制内圆</span>
context<span class="token punctuation">.</span><span class="token function">moveTo</span><span class="token punctuation">(</span><span class="token number">194</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">arc</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">94</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">2</span> <span class="token operator">*</span> Math<span class="token punctuation">.</span><span class="token constant">PI</span><span class="token punctuation">,</span> <span class="token boolean">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 绘制分针</span>
context<span class="token punctuation">.</span><span class="token function">moveTo</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">lineTo</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 绘制时针</span>
context<span class="token punctuation">.</span><span class="token function">moveTo</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">lineTo</span><span class="token punctuation">(</span><span class="token number">35</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 描画路径</span>
context<span class="token punctuation">.</span><span class="token function">stroke</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h3 id="文本"><a href="#文本" class="header-anchor">#</a> 文本</h3> <p>文本和图像混合也是常见的绘制需求，因此2D绘图上下文还提供了绘制文本的方法，即 fillText()和 strokeText()。这两个方法都接收 4 个参数：要绘制的字符串、x 坐标、y 坐标和可选的最大像素宽度。而且，这两个方法最终绘制的结果都取决于以下 3 个属性。</p> <ul><li>font：以 CSS 语法指定的字体样式、大小、字体族等，比如&quot;10px Arial&quot;。</li> <li>textAlign：指定文本的对齐方式，可能的值包括&quot;start&quot;、&quot;end&quot;、&quot;left&quot;、&quot;right&quot;和&quot;center&quot;。推荐使用&quot;start&quot;和&quot;end&quot;，不使用&quot;left&quot;和&quot;right&quot;，因为前者无论在从左到右书写的语言还是从右到左书写的语言中含义都更明确。</li> <li>textBaseLine ： 指 定 文 本 的 基 线 ， 可 能 的 值 包 括 &quot;top&quot; 、 &quot;hanging&quot; 、 &quot;middle&quot; 、&quot;alphabetic&quot;、&quot;ideographic&quot;和&quot;bottom&quot;。
这些属性都有相应的默认值，因此没必要每次绘制文本时都设置它们。fillText()方法使用fillStyle 属性绘制文本，而 strokeText()方法使用 strokeStyle 属性。通常，fillText()方法是使用最多的，因为它模拟了在网页中渲染文本。例如，下面的例子会在前一节示例的表盘顶部绘制数字“12”：</li></ul> <div class="language-js extra-class"><pre class="language-js"><code>context<span class="token punctuation">.</span>font <span class="token operator">=</span> <span class="token string">&quot;bold 14px Arial&quot;</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span>textAlign <span class="token operator">=</span> <span class="token string">&quot;center&quot;</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span>textBaseline <span class="token operator">=</span> <span class="token string">&quot;middle&quot;</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">fillText</span><span class="token punctuation">(</span><span class="token string">&quot;12&quot;</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>由于绘制文本很复杂，特别是想把文本绘制到特定区域的时候，因此 2D 上下文提供了用于辅助确定文本大小的 measureText()方法。这个方法接收一个参数，即要绘制的文本，然后返回一个TextMetrics 对象。这个返回的对象目前只有一个属性 width，不过将来应该会增加更多度量指标。</p> <p>measureText()方法使用 font、textAlign 和 textBaseline 属性当前的值计算绘制指定文本后的大小。例如，假设要把文本&quot;Hello world!&quot;放到一个 140 像素宽的矩形中，可以使用以下代码，从 100 像素的字体大小开始计算，不断递减，直到文本大小合适：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> fontSize <span class="token operator">=</span> <span class="token number">100</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span>font <span class="token operator">=</span> fontSize <span class="token operator">+</span> <span class="token string">&quot;px Arial&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">while</span><span class="token punctuation">(</span>context<span class="token punctuation">.</span><span class="token function">measureText</span><span class="token punctuation">(</span><span class="token string">&quot;Hello world!&quot;</span><span class="token punctuation">)</span><span class="token punctuation">.</span>width <span class="token operator">&gt;</span> <span class="token number">140</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
fontSize<span class="token operator">--</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span>font <span class="token operator">=</span> fontSize <span class="token operator">+</span> <span class="token string">&quot;px Arial&quot;</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
context<span class="token punctuation">.</span><span class="token function">fillText</span><span class="token punctuation">(</span><span class="token string">&quot;Hello world!&quot;</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">fillText</span><span class="token punctuation">(</span><span class="token string">&quot;Font size is &quot;</span> <span class="token operator">+</span> fontSize <span class="token operator">+</span> <span class="token string">&quot;px&quot;</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h3 id="图像"><a href="#图像" class="header-anchor">#</a> 图像</h3> <div class="language-js extra-class"><pre class="language-js"><code>context<span class="token punctuation">.</span><span class="token function">drawImage</span><span class="token punctuation">(</span>image<span class="token punctuation">,</span><span class="token number">50</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">)</span>
</code></pre></div><h3 id="阴影"><a href="#阴影" class="header-anchor">#</a> 阴影</h3> <div class="language-js extra-class"><pre class="language-js"><code>context<span class="token punctuation">.</span>shadowOffsetX <span class="token operator">=</span> <span class="token number">5</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span>shadowOffsetY <span class="token operator">=</span> <span class="token number">5</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span>shadowBlur <span class="token operator">=</span> <span class="token number">4</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span>shadowColor <span class="token operator">=</span> <span class="token string">&quot;rgba(0, 0, 0, 0.5)&quot;</span><span class="token punctuation">;</span>
<span class="token comment">// 绘制红色矩形</span>
context<span class="token punctuation">.</span>fillStyle <span class="token operator">=</span> <span class="token string">&quot;#ff0000&quot;</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">fillRect</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h3 id="渐变"><a href="#渐变" class="header-anchor">#</a> 渐变</h3> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> gradient <span class="token operator">=</span> context<span class="token punctuation">.</span><span class="token function">createLinearGradient</span><span class="token punctuation">(</span><span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">70</span><span class="token punctuation">,</span> <span class="token number">70</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
gradient<span class="token punctuation">.</span><span class="token function">addColorStop</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token string">&quot;white&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
gradient<span class="token punctuation">.</span><span class="token function">addColorStop</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">&quot;black&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 绘制渐变矩形</span>
context<span class="token punctuation">.</span>fillStyle <span class="token operator">=</span> gradient<span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">fillRect</span><span class="token punctuation">(</span><span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>为了让渐变覆盖整个矩形而不是其中的一部分，两者的坐标必须要搭配合适。</p> <h3 id="图案"><a href="#图案" class="header-anchor">#</a> 图案</h3> <p>图案是用于填充和描画图形的重复图像。要创建新图案，可以调用 createPattern()方法并传入两个参数：一个 HTML <img>元素和一个表示该如何重复图像的字符串。第二个参数的值与 CSS 的background-repeat 属性是一样的，包括&quot;repeat&quot;、&quot;repeat-x&quot;、&quot;repeat-y&quot;和&quot;no-repeat&quot;。比如：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> image <span class="token operator">=</span> document<span class="token punctuation">.</span>images<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
pattern <span class="token operator">=</span> context<span class="token punctuation">.</span><span class="token function">createPattern</span><span class="token punctuation">(</span>image<span class="token punctuation">,</span> <span class="token string">&quot;repeat&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// 绘制矩形</span>
context<span class="token punctuation">.</span>fillStyle <span class="token operator">=</span> pattern<span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">fillRect</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">150</span><span class="token punctuation">,</span> <span class="token number">150</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div></div> <footer class="page-edit" style="display:none;"><!----> <!----></footer> <!----> <!----> <!----></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div><APlayer audio="" fixed="true" theme="#b7daff" loop="loop" order="random" preload="auto" volume="0.7" mutex="true" lrc-type="3" list-folded="true" list-max-height="250" storage-name="vuepress-plugin-meting" id="aplayer-fixed"></APlayer></div></div>
    <script src="/assets/js/app.2d22f3f9.js" defer></script><script src="/assets/js/3.6721f6a0.js" defer></script><script src="/assets/js/1.546ea5a7.js" defer></script><script src="/assets/js/50.0ad5db28.js" defer></script>
  </body>
</html>
